<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(function() {
		$("#find_product_dialog").dialog({
			title:"商品信息",
			autoOpen: false,
			height: 500,
			width: 600,
			modal: true,
			buttons:[{
				text:"确定",
				click:function() {
					$("#product_info").val($("#find_product_text").val());
					$(this).dialog("close");
				}
			},{
				text:"取消",
				click:function() {
					$(this).dialog("close");
				}
			}]
		});
		
		/* $("#find_product_text").autocomplete({
			source:"${basePath}/scat/find_product.htm",
			select:function(event, ui) {
				$("#vague_product_info").val(ui.item.id);
			}
		}); */
		
		$("#find-product-button").click(function() {
			$("#product-table").load("${basePath}/scat/findProduct.htm?info="+$("#find_product_text").val());
		})
	});
	
	function selectProduct(id, name) {
		$("input[name*='temp-unit']").attr("disabled", "disabled");
		$("input[name*='temp-unit']").removeAttr("checked");
		$("input[name='"+id+"-temp-unit']").removeAttr("disabled");
		$("#vague_product_info").val(id);
		$("#find_product_text").val(name);
	}
	
	function selectUnit(unit) {
		$("#vague_product_unit").val(unit);
	}
</script>

<div id="find_product_dialog">
	年份-商品：
	<input type="text" id="find_product_text">&emsp;<input type="button" value="查询" id="find-product-button">
	<br><br>
	<div id="unit-div">
	<!-- <input type="radio" name="temp_unit" value="1" checked="checked">整装&nbsp;
	<input type="radio" name="temp_unit" value="2">散装&nbsp;
	<input type="radio" name="temp_unit" value="3">筒装 -->
	</div>
	<table id="product-table">
	</table>
    </div>
</div>